(deftemplate Elev
    (slot nume)
    (slot nota-mate)
    (slot nota-info)
    (slot nota-romana)
    (slot nota-fizica)   
    (slot nota-chimie) 
    (slot nota-sport) 
    (slot nota-engleza)
    
    )
(assert (Elev(nume Traian)(nota-mate 5)(nota-info 5)(nota-romana 8)(nota-fizica 5)(nota-chimie 5)(nota-sport 10)(nota-engleza 5)))
(assert (Elev(nume Luca)(nota-mate 10)(nota-info 9)(nota-romana 9)(nota-fizica 9)(nota-chimie 8)(nota-sport 5)(nota-engleza 8)))
(assert (Elev(nume Vadim)(nota-mate 10)(nota-info 10)(nota-romana 10)(nota-fizica 10)(nota-chimie 10)(nota-sport 10)(nota-engleza 9)))
(assert (Elev(nume Alex)(nota-mate 8)(nota-info 9)(nota-romana 10)(nota-fizica 7)(nota-chimie 8)(nota-sport 5)(nota-engleza 8)))
(assert (Elev(nume Ghilua)(nota-mate 7)(nota-info 8)(nota-romana 5)(nota-fizica 5)(nota-chimie 8)(nota-sport 9)(nota-engleza 5)))
(assert (Elev(nume Emil)(nota-mate 2)(nota-info 3)(nota-romana 1)(nota-fizica 4)(nota-chimie 2)(nota-sport 10)(nota-engleza 3)))
(facts)
(run)

(printout t "********************************************" crlf)
(defrule mate-info
   (Elev (nume ?n)(nota-mate ?mm)(nota-info ?mi )(nota-fizica ?mf))
        (test (and(>= ?mm 8)(>= ?mi 8)(>= ?mf 8)))
 
=>
(printout t "Elevul " ?n " se poate inscrie la facultatea de Matematica si informatica! " crlf)
)

(run)
(printout t "**********************************************" crlf)
(defrule Chimie
   (Elev (nume ?n)(nota-mate ?mm)(nota-chimie ?mc))
        (test (and(>= ?mm 8)(>= ?mc 9)))
 
=>
(printout t "Elevul " ?n " se poate inscrie la fac de Chimie! " crlf)
)

(run)
(printout t "********************************************" crlf)
(defrule Sport
   (Elev (nume ?n)(nota-sport ?ms))
        (test (>= ?ms 8))
 
=>
(printout t "Elevul " ?n " se poate inscrie la fac de Sport! " crlf)
)

(run)
(printout t "********************************************" crlf)
(defrule Litere
   (Elev (nume ?n)(nota-romana ?mr)(nota-engleza ?me))
        (test (and(>= ?mr 8)(>= ?me 9)))
 
=>
(printout t "Elevul " ?n " se poate inscrie la fac de Litere! " crlf)
)


(printout t "********************************************" crlf)
(defrule NIMIC
   (Elev (nume ?n)(nota-romana ?mr)(nota-engleza ?me))
        (test (and(<= ?mr 5)(<= ?me 5)))
 
=>
(printout t "Elevul " ?n " NU MERGE LA FACULTATE! " crlf)
)
(printout t "********************************************" crlf)
(run)